/*
 * @Author: WangLong
 * @Date: 2024-01-30 14:31:33
 * @LastEditTime: 2024-03-05 10:35:03
 * @LastEditors: WangLong
 * @Description:
 * @FilePath: \front_erp\src\api\stock\returnapply.js
 */
import request from "@/utils/request";

// 获取出库列表
export function getReturnListApi(query, data) {
  return request({
    url: "/system/stockReturnApply/list",
    method: "post",
    params: query,
    data,
  });
}
// 新增退库申请
export function addReturnApi(data) {
  return request({
    url: "/system/stockReturnApply/saveAdd",
    method: "post",
    data,
  });
}

// 打开新增获取-默认信息显示
export function showAddReturnTemp(typeId) {
  return request({
    url: "/system/stockReturnApply/showAdd",
    method: "get",
    params: { typeId },
  });
}
// 编辑退库申请
export function editReturnApi(data) {
  return request({
    url: "/system/stockReturnApply/saveEdit",
    method: "post",
    data,
  });
}
// 删除退库申请
export function deleteReturn(stockReturnId) {
  return request({
    url: `/system/stockReturnApply/delete`,
    method: "get",
    params: { stockReturnId },
  });
}
// 获取详情信息
export function getReturnStock(params) {
  return request({
    url: `/system/stockReturnApply/getInfo`,
    method: "get",
    params,
    // params: { stockReturnId },
  });
}
// 入库审核-审核页面提交按钮
export function checkReturnApi(data) {
  return request({
    url: "/system/stockReturnApply/approval",
    method: "post",
    data,
  });
}
// 入库审核-审核同意后点击入库按钮
export function showAddDtl(stockReturnDetailId) {
  return request({
    url: "/system/stockReturnApply/showAddDtl",
    method: "get",
    params: { stockReturnDetailId },
  });
}
// 入库审核-点击入库后点击修改按钮
export function showModDtl(materialCode) {
  return request({
    url: "/system/stockReturnApply/showModDtl",
    method: "get",
    params: { materialCode },
  });
}
// 入库审核-点击入库后点击添加按钮
export function checkReturnAddDtl(data) {
  return request({
    url: "/system/stockReturnApply/saveAddDtl",
    method: "post",
    data,
  });
}
// 撤销退库申请
export function checkCancelAddDdl(stockReturnId) {
  return request({
    url: "/system/stockReturnApply/cancel",
    method: "get",
    params: { stockReturnId },
  });
}
// 退库申请主设备物资序列号
export function temporaryMaterialDetail(materialNumber) {
  return request({
    url: "/system/temparyMaterialDetail/getTemporaryMaterialDetail",
    method: "get",
    params: { materialNumber },
  });
}

export function autoCompleteMaterialList(data) {
  return request({
    url: "/system/pub/autoCompleteMaterialList",
    method: "post",
    data: data,
  });
}

